﻿using Avalonia.Controls;
using Avalonia.Controls.Templates;
namespace Launcher;

public class Locator:IDataTemplate
{
    public Control? Build(object? param)
    {
        if (param is Channel channel)
        {
            var panel = new MainWindowRightPanel
            {
                DataContext = new MainWindowRightPanelModel(channel)
            };
            return panel;
        }

        return null;
    }

    public bool Match(object? data)=> data is Channel;
}